﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.User
{
    /// <summary>
    /// 实体字段配置（存储业务实体的动态字段）
    /// </summary>
    [Table("entityfieldconfig")]
    public class EntityFieldConfig : AuditEntity
    {
        /// <summary>
        /// 关联的业务实体（如“ProductionOrder”）
        /// </summary>
        [Required]
        public string BusinessEntity { get; set; }

        /// <summary>
        /// 字段名称（如“ProduceCode”）
        /// </summary>
        [Required]
        public string FieldName { get; set; }

        /// <summary>
        /// 字段显示名称（如“生产工单编号”）
        /// </summary>
        [Required]
        public string DisplayName { get; set; }

        /// <summary>
        /// 字段类型（如“String”“Int32”）
        /// </summary>
        [Required]
        public string FieldType { get; set; }

        /// <summary>
        /// 是否为主键
        /// </summary>
        public bool IsPrimaryKey { get; set; }

        /// <summary>
        /// 是否为单据编码字段
        /// </summary>
        public bool IsCodeField { get; set; }
    }
}
